#!/usr/bin/env bash


target=$1

if [ ! -n "${target}" ];then

    echo "target is null"
    exit 1
fi

output="${target}.out"


compile_arg="-g"



gcc ${target} ${compile_arg} -o "${output}"
if [ $? != 0 ];then
    echo ">>> compile failed: <${target}>"
    exit 1
fi

echo ">>> compile success: <${output}>"
echo "===RUN==="
echo "========="
./${output}
echo "========="
echo "===END==="
